<?php

namespace Modules\Admin\Http\Controllers\Renovations;

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Modules\Common\General\Security\Api\Gateway;
use Modules\Common\Models\AdminLog;
use Modules\Common\Models\Renovations;
use Modules\Common\Util\Api;
use Modules\Common\Util\Database;


class Retrieve
{
     /**
     * @Route(path=/api/admin/renovations)
     */
    public function retrieve()
    {
        $query = Renovations::with(['adminUser']);

        $query->orderByRaw('id desc , created_at desc');

        $sidDefault = auth('api')->user()->sid;
        $eidDefault = auth('api')->user()->eid; 
        $data = $query->where('eid',$eidDefault)->paginate(request('per_page', 15));
        return Api::success($data);
    }

}